465247355 by Unknown

465247355 by Unknown

Author:Unknown
Language: eng
Format: epub


void loop() {

//Turns on each LED at a time (make 5V appear at each pin)

digitalWrite(led1, HIGH);

delay(ledspeed);

digitalWrite(led2, HIGH);

delay(ledspeed);

digitalWrite(led3, HIGH);

delay(ledspeed);

digitalWrite(led4, HIGH);

delay(ledspeed);

//Turns off the LEDs one at a time then repeats the process

digitalWrite(led1, LOW);

delay(ledspeed);

digitalWrite(led2, LOW);

delay(ledspeed);

digitalWrite(led3, LOW);

delay(ledspeed);

digitalWrite(led4, LOW);

delay(ledspeed);

}

Save the code above as Running_LEDs and upload it to Arduino. Remember, if you copy and paste code, clear everything from the IDE first before pasting. The IDE should be blank before pasting. Practice this project by altering the code so that it runs in reverse after counting to the last LED. Another cool thing to do is to change the positions of the LEDs in the code to come up with interesting patterns.

Working with Push-buttons



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.